/**
 * Created by yjj on 2017/5/3.
 */
import axios from 'axios';
import {API_NEW_VERSION} from '../api';

const TRUNK_TASKS_PRINT_LOADING_LIST = API_NEW_VERSION + 'trunk_tasks/print_loading_list';

export const pringTrunkTasksPageANDLoadingList = params => {
  return axios.get(TRUNK_TASKS_PRINT_LOADING_LIST, {params: params});
};
export const trunkTasksPage = params => {
  return axios.get(API_NEW_VERSION + 'trunk_tasks_contain_loading_list_trunk_task', {params: params});
};
export const trunkTasksPageSub = params => {
  return axios.get(API_NEW_VERSION + 'trunk_tasks_contain_loading_list_trunk_task_sub', {params: params});
};

export const goodsVehicleStatistics = () => {
  return axios.get(API_NEW_VERSION + 'trunk_tasks_goods_vehicle_statistics');
};

export const sendRegionAndNum = params => {
  return axios.get(API_NEW_VERSION + `trunk_tasks_send_region_and_num`, {params: params});
};

export const shipmentsRegionAndNum = params => {
  return axios.get(API_NEW_VERSION + `trunk_tasks_shipments_region_and_num`, {params: params});
};

export const splitTrunkTask = (id, data) => {
  return axios.post(API_NEW_VERSION + 'trunk_tasks/' + id + '/split', data);
};

export const cancleSplitTrunkTask = (id) => {
  return axios.delete(API_NEW_VERSION + 'trunk_tasks/' + id + '/cancel_split');
};

export const isCancleSplitTrunkTask = (id) => {
  return axios.get(API_NEW_VERSION + 'trunk_tasks/' + id + '/cancel_split');
};

export const searchTrunkTask = params => {
  return axios.get(API_NEW_VERSION + 'trunk_tasks/self_extract', {params: params});
};

export const loadSearchTrunkTaskAgeingWarningStatic = params => {
  return axios.get(API_NEW_VERSION + 'transit/self_extracts/ageing_warning_static', {params: params});
};
